solving an equation with a variable on both sides